package com.zhijian.medical.dao.local;


import com.zhijian.medical.entity.po.Person;
import com.zhijian.medical.entity.vo.request.PersonSearchVo;
import com.zhijian.medical.entity.vo.response.PersonExamRecordVo;
import com.zhijian.medical.entity.vo.response.PersonVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface PersonMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Person record);

    int insertSelective(Person record);

    Person selectByPrimaryKey(Long id);

    /**
     * 根据手机号查询
     *
     * @param phone
     * @return
     */
    Person selectByPhone(String phone);

    int updateByPrimaryKeySelective(Person record);

    int updateByPrimaryKey(Person record);

    int count(PersonSearchVo personSearchVo);

    List<PersonVo> selectList(PersonSearchVo personSearchVo);

    PersonVo selectVoById(Long id);

    /**
     * 根据工号查询
     *
     * @param jobNumber
     * @return
     */
    PersonVo selectVoByJobNumber(String jobNumber);

    /**
     * 根据工号与密码查询，密码可不填
     *
     * @param jobNumber
     * @param password
     * @return
     */
    Person selectByJobNumberAndPassword(@Param("jobNumber") String jobNumber, @Param("password") String password);

    /**
     * 根据人员id查询考核记录
     *
     * @param userId
     * @return
     */
    List<PersonExamRecordVo> selectPersonExamRecordVoByUserId(@Param("userId") Long userId);

    /**
     * 姓名查询vo
     *
     * @param name
     * @return
     */
    PersonVo selectVoByName(String name);

    /**
     * 查询出某天最新数据的code
     *
     * @return
     */
    String selectMaxCodeByDay(@Param("type") Byte type, @Param("day") String day);

}